Skip to content

fix(tui): show context percentage relative to input limit - #39558

Open
govindti wants to merge 1 commit into
anomalyco:devfrom
govindti:fix-compaction-threshold
Open

fix(tui): show context percentage relative to input limit#39558
govindti wants to merge 1 commit into
anomalyco:devfrom
govindti:fix-compaction-threshold

Conversation

@govindti

@govindti govindti commented Jul 29, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #38851

Type of change

  • Bug fix

What does this PR do?

TUI context indicator used limit.context as denominator, but compaction triggers based on limit.input. For gpt-5.6-sol (input=372K, context=500K) this meant compaction started when TUI showed ~30-35%. Now uses limit.input when present, falling back to limit.context.

How did you verify your code works?

Ran bun typecheck in packages/tui — passes cleanly.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Compaction triggers based on limit.input (when available), but the TUI
context indicator used limit.context as the denominator. For models where
limit.input < limit.context (e.g. gpt-5.6-sol via codex: input=372K vs
context=500K), this caused compaction to start when the TUI showed only
~30-35% usage.

Now uses limit.input when present, falling back to limit.context, so the
displayed percentage reflects when compaction will actually fire.

Fixes anomalyco#38851
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tui: compaction triggers around 30–35% with gpt-5.6-sol

1 participant